﻿namespace GSC.WebControls
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Web.UI.Design;
    using System.Web.UI.Design.WebControls;
    using System.ComponentModel;
    using System.Web.UI;
    using System.Web;
    using System.Web.UI.WebControls;
    using System.IO;
    using System.ComponentModel.Design;
    using System.Web.UI.HtmlControls;
    using System.Drawing;
    class BackgroundCenterEndControlDesigner : CompositeControlDesigner
    {
        private BackgroundCenterEndControl _CenterEnd;
        /// <summary>
        /// </summary>
        /// <param name="Component"></param>
        public override void Initialize(IComponent Component)
        {
            base.Initialize(Component);
            this._CenterEnd = (BackgroundCenterEndControl)Component;
        }
        /*
        /// <summary>
        /// </summary>
        /// <returns></returns>
        public override string GetDesignTimeHtml()
        {
            try
            {    this.CreateChildControls();
                StringWriter sw = new StringWriter();
                HtmlTextWriter hw = new HtmlTextWriter(sw);
                Panel panel = new Panel();
                Table table = new Table();
                table.CellPadding = 0;
                table.CellSpacing = 0;
                table.BorderWidth = Unit.Pixel(0);
                table.BackColor = _CenterEnd.BackColor;
                table.BorderColor = _CenterEnd.BorderColor;
                table.BorderStyle = _CenterEnd.BorderStyle;
                table.BorderWidth = _CenterEnd.BorderWidth;
                table.Width = _CenterEnd.Width;
                table.Height = _CenterEnd.Height;
                table.Style["table-layout"] = "fixed";
                table.Style["overflow"] = "hidden";
                panel.Controls.Add(table);
                TableRow row = new TableRow();
                table.Rows.Add(row);
                TableCell MenuCell = new TableCell();
                MenuCell.Height = _CenterEnd.Height;
                MenuCell.Width = _CenterEnd.MenuCellWidth;
                MenuCell.Style["overflow"] = "hidden";
                MenuCell.Style["background-position"] = "left top";
                if (string.IsNullOrEmpty(_CenterEnd.MenuCellBackImage))
                    MenuCell.Style["background-image"] = "url(" + _CenterEnd.ResolveClientUrl(_CenterEnd.GetWebResourceUrl("Menu.gif")) + ")";
                else
                    MenuCell.Style["background-image"] = "url(" + _CenterEnd.ResolveClientUrl(_CenterEnd.MenuCellBackImage) + ")";
                row.Cells.Add(MenuCell);
                TableCell LeftCell = new TableCell();
                LeftCell.Height = _CenterEnd.Height;
                LeftCell.Width = _CenterEnd.LeftCellWidth;
                LeftCell.Style["overflow"] = "hidden";
                LeftCell.Style["background-position"] = "left top";
                if (string.IsNullOrEmpty(_CenterEnd.LeftCellBackImage))
                    LeftCell.Style["background-image"] = "url(" + _CenterEnd.ResolveClientUrl(_CenterEnd.GetWebResourceUrl("Left.gif")) + ")";
                else
                    LeftCell.Style["background-image"] = "url(" + _CenterEnd.ResolveClientUrl(_CenterEnd.LeftCellBackImage) + ")";
                row.Cells.Add(LeftCell);
                TableCell CenterCell = new TableCell();
                CenterCell.Style["overflow"] = "hidden";
                CenterCell.Style["background-position"] = "left top";
                if (string.IsNullOrEmpty(_CenterEnd.CenterCellBackImage))
                    CenterCell.Style["background-image"] = "url(" + _CenterEnd.ResolveClientUrl(_CenterEnd.GetWebResourceUrl("Center.gif")) + ")";
                else
                    CenterCell.Style["background-image"] = "url(" + _CenterEnd.ResolveClientUrl(_CenterEnd.CenterCellBackImage) + ")";
                row.Cells.Add(CenterCell);
                TableCell RightCell = new TableCell();
                RightCell.Height = _CenterEnd.Height;
                RightCell.Width = _CenterEnd.RightCellWidth;
                RightCell.Style["overflow"] = "hidden";
                RightCell.Style["background-position"] = "left top";
                if (string.IsNullOrEmpty(_CenterEnd.RightCellBackImage))
                    RightCell.Style["background-image"] = "url(" + _CenterEnd.ResolveClientUrl(_CenterEnd.GetWebResourceUrl("Right.gif")) + ")";
                else
                    RightCell.Style["background-image"] = "url(" + _CenterEnd.ResolveClientUrl(_CenterEnd.RightCellBackImage) + ")";
                row.Cells.Add(RightCell);
                panel.RenderControl(hw);
                return sw.ToString();
            }
            catch (Exception ex)
            {
                return ex.ToString();
            }
        }
         */ 
    }
}